//
// Created by yewei on 2023/1/5.
//
#include <bits/stdc++.h>

using namespace std;

int main() {
    freopen("../input.txt", "r", stdin);
    string s;
    cin>>s;
    int pre,now;
    pre = s[0]-'0';
    int cnt = 1;
    for(int i=1;i<s.length();i++){
        now = s[i]-'0';
        if(now == pre) cnt++;
        else{
            cout<<cnt<<pre;
            pre = now;
            cnt = 1;
        }
    }
    cout<<cnt<<now;
}
